﻿using Microsoft.AspNetCore.Authentication;
using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Mvc;
using TR.AppService.AppService.Sys_Messages;
using TR.Domain.Entity;

namespace TR.WebApi.Controllers.Sys_MessagesControllers
{
    [Route("api/[controller]")]
    [ApiController]
    public class SystemMessagesController : ControllerBase
    {
        private readonly ISystemMessagesAppService systemMessagesAppService;

        public SystemMessagesController(ISystemMessagesAppService systemMessagesAppService)
        {
            this.systemMessagesAppService = systemMessagesAppService;
        }

        //系统消息-分页查询
        [HttpGet]
        public async Task<FenYe<sys_Message>> sys_MessagesFenYe(int pageSize, int currentPage, string str)
        {
            return await systemMessagesAppService.SysMesFenYe(pageSize, currentPage, str);
        }

        //系统消息-未读修改为已读
        [HttpPut]
        public async Task<bool> UpdateSysMesDel(int msg_id, string rcv_man)
        {
            return await systemMessagesAppService.UpdateSysMes(msg_id, rcv_man);
        }
    }
}
